#!/usr/bin/evn python
# -*- coding: UTF-8 -*-
# @File: add_member_page.py
# @Author: fy
# @date: 2021/9/7 10:05
from appium.webdriver.common.mobileby import MobileBy
from time import sleep
from pages.base_page import BasePage
from pages.manual_input_member_page import ManualInputMemberPage


class AddMemberPage(BasePage):
    _manual_input_member_locator = (MobileBy.XPATH, '//*[@text="手动输入添加"]')

    def click_manual_input_page(self):
        '''
        点击手动输入添加
        :return: ManualInputMemberPage
        '''
        self.find_and_click(self._manual_input_member_locator)
        return ManualInputMemberPage(self.driver)

    def check_add_mem_sucessed(self):
        '''
        检查token存在
        :return:
        '''
        sleep(1)
        token_text_locator = (MobileBy.XPATH, '//*[@text="添加成功"]')
        return self.find_token_exist(token_text_locator)


